Skip to content

chore: add ANN type annotations to faiss, fastembed, firecrawl, github, google_ai#2988

Merged
julian-risch merged 1 commit intomainfrom
feat/faiss-fastembed-firecrawl-github-google-ai-type-annotations
Mar 19, 2026
Merged

chore: add ANN type annotations to faiss, fastembed, firecrawl, github, google_ai#2988
julian-risch merged 1 commit intomainfrom
feat/faiss-fastembed-firecrawl-github-google-ai-type-annotations

Conversation

@julian-risch
Copy link
Copy Markdown
Member

@julian-risch julian-risch commented Mar 18, 2026

Related Issues

Proposed Changes

Enable ruff's ANN ruleset (flake8-annotations) for five integrations and fix all resulting violations. Changes are consistent across all integrations:

  • faiss: Enable ANN in ruff config; add -> None to __init__ in FAISSDocumentStore and FAISSEmbeddingRetriever; add -> None to _create_new_index
  • fastembed: Enable ANN in ruff config; add -> None to __init__ in _FastembedEmbeddingBackend, _FastembedSparseEmbeddingBackend, and FastembedRanker; add -> None to warm_up in FastembedRanker
  • firecrawl: Enable ANN in ruff config only (all annotations were already present)
  • github: Enable ANN in ruff config; add -> None to __init__ in all 6 connector classes and 6 tool classes
  • google_ai: Enable ANN in ruff config; add -> None to __init__ in both generators; add -> "GoogleAIGeminiGenerator" to __new__ with proper *_: Any and **kwargs: Any annotations; add -> dict[str, list[str]] / -> dict[str, list[ChatMessage]] to run and run_async methods

For all integrations:

  • Added "ANN" to ruff select
  • Added "ANN401" to ruff ignore (allow Any at SDK/dynamic boundaries)
  • Added "ANN" to tests/**/* per-file-ignores (tests don't need type annotations)

How did you test it

  • Ran hatch run fmt-check for all 5 integrations — all pass
  • Ran hatch run test:types for all 5 integrations — all pass (google_ai pre-existing errors are unchanged)
  • Verified ruff check --select ANN --ignore ANN401 reports zero violations across all 5 integrations

Notes for reviewer

google_ai has pre-existing mypy errors unrelated to this PR. It's archived anyway.

Checklist

  • I have read the contributing guidelines
  • I have updated the related documentation if needed
  • I have added tests for the changes I made (N/A - annotation-only changes)
  • I have run hatch run test:types and all checks pass
  • I have run hatch run fmt-check and all checks pass

🤖 Generated with Claude Code

…, google_ai

Enable ruff ANN ruleset (excluding ANN401) for five integrations and fix
all resulting violations by adding missing return type annotations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@julian-risch julian-risch changed the title feat: add ANN type annotations to faiss, fastembed, firecrawl, github, google_ai chore: add ANN type annotations to faiss, fastembed, firecrawl, github, google_ai Mar 18, 2026
@julian-risch julian-risch marked this pull request as ready for review March 18, 2026 17:49
@julian-risch julian-risch requested a review from a team as a code owner March 18, 2026 17:49
@julian-risch julian-risch requested review from davidsbatista and removed request for a team March 18, 2026 17:49
@julian-risch julian-risch merged commit 0c470d1 into main Mar 19, 2026
29 checks passed
@julian-risch julian-risch deleted the feat/faiss-fastembed-firecrawl-github-google-ai-type-annotations branch March 19, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants